package com.example.mweather.utils;

import com.example.mweather.R;

public class WeatherUtil {

    public static String genDescriptionBySkycon(String skycon) {
        String description;
        switch (skycon) {
            case "PARTLY_CLOUDY_DAY":
            case "PARTLY_CLOUDY_NIGHT":
                description = "多云";
                break;
            case "CLOUDY":
                description = "阴";
                break;
            case "LIGHT_HAZE":
                description = "轻度雾霾";
                break;
            case "MODERATE_HAZE":
                description = "中度雾霾";
                break;
            case "HEAVY_HAZE":
                description = "重度雾霾";
                break;
            case "LIGHT_RAIN":
                description = "小雨";
                break;
            case "MODERATE_RAIN":
                description = "中雨";
                break;
            case "HEAVY_RAIN":
                description = "大雨";
                break;
            case "STORM_RAIN":
                description = "暴雨";
                break;
            case "FOG":
                description = "雾";
                break;
            case "LIGHT_SNOW":
                description = "小雪";
                break;
            case "MODERATE_SNOW":
                description = "中雪";
                break;
            case "HEAVY_SNOW":
                description = "大雪";
                break;
            case "STORM_SNOW":
                description = "爆雪";
                break;
            case "DUST":
                description = "浮尘";
                break;
            case "SAND":
                description = "沙尘";
                break;
            case "WIND":
                description = "风";
                break;
            default:
                description = "晴";
                break;
        }
        return description;
    }

    public static int genIconBySkycon(String skycon) {
        int resId;
        switch (skycon) {
            case "PARTLY_CLOUDY_DAY":
            case "PARTLY_CLOUDY_NIGHT":
                resId = R.mipmap.ic_partly_cloudy;
                break;
            case "CLOUDY":
                resId = R.mipmap.ic_cloudy;
                break;
            case "LIGHT_HAZE":
            case "MODERATE_HAZE":
            case "HEAVY_HAZE":
                resId = R.mipmap.ic_haze;
                break;
            case "LIGHT_RAIN":
                resId = R.mipmap.ic_l_rain;
                break;
            case "MODERATE_RAIN":
                resId = R.mipmap.ic_m_rain;
                break;
            case "HEAVY_RAIN":
                resId = R.mipmap.ic_h_rain;
                break;
            case "STORM_RAIN":
                resId = R.mipmap.ic_s_rain;
                break;
            case "FOG":
                resId = R.mipmap.ic_fog;
                break;
            case "LIGHT_SNOW":
                resId = R.mipmap.ic_l_snow;
                break;
            case "MODERATE_SNOW":
                resId = R.mipmap.ic_m_snow;
                break;
            case "HEAVY_SNOW":
                resId = R.mipmap.ic_h_snow;
                break;
            case "STORM_SNOW":
                resId = R.mipmap.ic_s_snow;
                break;
            case "DUST":
                resId = R.mipmap.ic_dust;
                break;
            case "SAND":
                resId = R.mipmap.ic_sand;
                break;
            case "WIND":
                resId = R.mipmap.ic_wind;
                break;
            default:
                resId = R.mipmap.ic_sun;
                break;
        }
        return resId;
    }
}
